const express = require('express');
const auth = require('../../middleware/auth');

const router = express.Router();

// 获取能耗数据
router.get('/consumption', auth, async (req, res) => {
  try {
    const consumption = {
      today: 2847.5,
      yesterday: 2654.3,
      thisWeek: 19832.1,
      thisMonth: 85420.3,
      trend: 'up'
    };

    res.json(consumption);
  } catch (error) {
    console.error('Get energy consumption error:', error);
    res.status(500).json({ error: '获取能耗数据失败' });
  }
});

module.exports = router;

